////多重继承
//#include <iostream>
//using namespace std;
//
//class A {
//public:
//
//	int m_a;
//};
//
//class B {
//public:
//
//	int m_b;
//};
//class C {
//public:
//
//	int m_c;
//};
//class D :public A, public B, public C {//汇聚子类
//public:
//	int m_d;
//};
//
//int main(void) {
//	D d;// A基类子对象|B基类子对象|C基类子对象|m_d|-->m_a,m_b,m_c
//	cout << "汇聚子类大小" << sizeof(d) << endl;
//	D* pd = &d;
//	cout << "整个汇聚子类对象首地址 D*pd" << pd << endl;
//	cout << "A基类子对象的首地址:" << &d.m_a << endl;
//	cout << "B基类子对象的首地址:" << &d.m_b << endl;
//	cout << "C基类子对象的首地址:" << &d.m_c << endl;
//	cout << "子类子对象的首地址:" << &d.m_d << endl;
//
//	cout << "-----------隐式转换--------" << endl;
//	A* pa = pd;
//	cout << "D* pd-->A*pa:" << pa << endl;
//	B* pb = pd;
//	cout << "D* pd-->B* pb:" << pb << endl;
//	C* pc = pd;
//	cout << "D* pd->C* pb:" << pc << endl;
//
//	cout << "-----------静态转换--------" << endl;
//	D* p1 = static_cast<D*>(pa);
//	cout << "A* pa--> D* p1:" << p1 << endl;
//	D* p2 = static_cast<D*>(pb);
//	cout << "B* pa--> D* p2:" << p2 << endl;
//	D* p3 = static_cast<D*>(pc);
//	cout << "C* pa--> D* p3:" << p3 << endl;
//
//	cout << "-------------重解释转换--------------" << endl;
//	pa = reinterpret_cast<A*>(pd);
//	cout << "D* pd-->A*pa:" << pa << endl;
//	pb = reinterpret_cast<B*>(pd);
//	cout << "D* pd-->B* pb:" << pb << endl;
//	pc = reinterpret_cast<C*>(pd);
//	cout << "D* pd->C* pb:" << pc << endl;
//	return 0;
//}